浮点数的比较3
#pragma warning(disable:4996)
#include<stdio.h>
#include<math.h>
int main()
{
        double x = 1.0;
        double y = 0.1;
        printf("%.50lf\n", x);
        printf("%.50lf\n", y);
        
        printf("\n");
        
        printf("%.50f\n", x - 0.9);
        printf("%.50f\n", y);
        if (fabs((x - 0.9)-y)<=0.01)
               //fabs绝对值函数，头文件为math.h
        {
               printf("same!\n");
        }
        else
        {
               printf("different!\n");
        }
        return 0;
}

